package com.qqtech.qquan.draw.dao;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.qqtech.core.frame.dao.BaseDaoImpl;
import com.qqtech.qquan.draw.model.DrawBatch;
import com.qqtech.qquan.draw.model.DrawBatchQuery;
import com.qqtech.qquan.draw.model.DrawBatchVo;

@Repository
public class DrawBatchDaoImpl extends BaseDaoImpl<DrawBatch> implements DrawBatchDao {
	public static final Logger log = LoggerFactory.getLogger(DrawBatchDaoImpl.class);

	@Override
	public int updateMinusQuantity(Integer id) {
		return this.sqlSessionTemplate.update(getSqlName("updateMinusQuantity"), id);
	}

	@Override
	public List<DrawBatchVo> queryList4Draw(DrawBatchQuery drawBatchQuery, Pageable pageable) {
		return sqlSessionTemplate.selectList(getSqlName("select4Draw"), getParams(drawBatchQuery, pageable));
	}
}
